package com.wcar.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 余额详细
 * @TableName tb_user_balance_log
 */
@TableName(value ="tb_user_balance_log")
@Data
public class UserBalanceLog implements Serializable {
    /**
     * 余额日志ID
     */
    @TableField(exist = false)
    private String storeName;


    @TableId(type = IdType.AUTO)
    private Integer balanceLogId;

    /**
     * 外键，关联用户ID
     */
    private Integer userId;

    /**
     * 外键关联门店id
     */
    private Integer storeId;

    /**
     * 支出金额
     */
    private Integer expenditure;

    /**
     * 实际充值金额
     */
    private Integer  rechargeMoney;

    /**
     * 优惠金额
     */
    private Integer discountsMoney;

    /**
     * 实际到账金额 (实际充值金额+优惠金额)
     */
    private Integer accountMoney;
    /**
     * 充值时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date rechargeTime;
    /**
     * 支出时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date expenditureTime;
    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 余额日志ID
     */
    public Integer getBalanceLogId() {
        return balanceLogId;
    }

    /**
     * 余额日志ID
     */
    public void setBalanceLogId(Integer balanceLogId) {
        this.balanceLogId = balanceLogId;
    }

    /**
     * 外键，关联用户ID
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 外键，关联用户ID
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 外键关联门店id
     */
    public Integer getStoreId() {
        return storeId;
    }

    /**
     * 外键关联门店id
     */
    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    /**
     * 支出金额
     */
    public Integer getExpenditure() {
        return expenditure;
    }

    /**
     * 支出金额
     */
    public void setExpenditure(Integer expenditure) {
        this.expenditure = expenditure;
    }

    /**
     * 实际充值金额
     */
    public Integer getRechargeMoney() {
        return rechargeMoney;
    }

    /**
     * 实际充值金额
     */
    public void setRechargeMoney(Integer rechargeMoney) {
        this.rechargeMoney = rechargeMoney;
    }

    /**
     * 优惠金额
     */
    public Integer getDiscountsMoney() {
        return discountsMoney;
    }

    /**
     * 优惠金额
     */
    public void setDiscountsMoney(Integer discountsMoney) {
        this.discountsMoney = discountsMoney;
    }

    /**
     * 实际到账金额 (实际充值金额+优惠金额)
     */
    public Integer getAccountMoney() {
        return accountMoney;
    }

    /**
     * 实际到账金额 (实际充值金额+优惠金额)
     */
    public void setAccountMoney(Integer accountMoney) {
        this.accountMoney = accountMoney;
    }

    /**
     * 充值时间
     */
    public Date getRechargeTime() {
        return rechargeTime;
    }

    /**
     * 充值时间
     */
    public void setRechargeTime(Date rechargeTime) {
        this.rechargeTime = rechargeTime;
    }

    /**
     * 支出时间
     */
    public Date getExpenditureTime() {
        return expenditureTime;
    }

    /**
     * 支出时间
     */
    public void setExpenditureTime(Date expenditureTime) {
        this.expenditureTime = expenditureTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserBalanceLog other = (UserBalanceLog) that;
        return (this.getBalanceLogId() == null ? other.getBalanceLogId() == null : this.getBalanceLogId().equals(other.getBalanceLogId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getExpenditure() == null ? other.getExpenditure() == null : this.getExpenditure().equals(other.getExpenditure()))
            && (this.getRechargeMoney() == null ? other.getRechargeMoney() == null : this.getRechargeMoney().equals(other.getRechargeMoney()))
            && (this.getDiscountsMoney() == null ? other.getDiscountsMoney() == null : this.getDiscountsMoney().equals(other.getDiscountsMoney()))
            && (this.getAccountMoney() == null ? other.getAccountMoney() == null : this.getAccountMoney().equals(other.getAccountMoney()))
            && (this.getRechargeTime() == null ? other.getRechargeTime() == null : this.getRechargeTime().equals(other.getRechargeTime()))
            && (this.getExpenditureTime() == null ? other.getExpenditureTime() == null : this.getExpenditureTime().equals(other.getExpenditureTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBalanceLogId() == null) ? 0 : getBalanceLogId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getExpenditure() == null) ? 0 : getExpenditure().hashCode());
        result = prime * result + ((getRechargeMoney() == null) ? 0 : getRechargeMoney().hashCode());
        result = prime * result + ((getDiscountsMoney() == null) ? 0 : getDiscountsMoney().hashCode());
        result = prime * result + ((getAccountMoney() == null) ? 0 : getAccountMoney().hashCode());
        result = prime * result + ((getRechargeTime() == null) ? 0 : getRechargeTime().hashCode());
        result = prime * result + ((getExpenditureTime() == null) ? 0 : getExpenditureTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", balanceLogId=").append(balanceLogId);
        sb.append(", userId=").append(userId);
        sb.append(", storeId=").append(storeId);
        sb.append(", expenditure=").append(expenditure);
        sb.append(", rechargeMoney=").append(rechargeMoney);
        sb.append(", discountsMoney=").append(discountsMoney);
        sb.append(", accountMoney=").append(accountMoney);
        sb.append(", rechargeTime=").append(rechargeTime);
        sb.append(", expenditureTime=").append(expenditureTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
